<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>自定义 GeoIP 数据库的目录</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.geoip-setup-custom-directory" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_setup_custom_directory</h1>
  <p class="verinfo">(PECL geoip &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">geoip_setup_custom_directory</span> &mdash; <span class="dc-title">自定义 GeoIP 数据库的目录</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-setup-custom-directory-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>geoip_setup_custom_directory</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
   ) : <span class="type"><span class="type void">void</span></span></div>


  <p class="para rdfs-comment">
  <span class="function"><strong>geoip_setup_custom_directory()</strong></span> 函数将会更改 GeoIP 数据库的默认目录。这个设置和直接在 php 配置文件中设置的<a href="geoip.configuration.html#ini.geoip.custom-directory" class="link">geoip.custom_directory</a>参数效果是一样的。
  </p>
  
 </div>

 <div class="refsect1 parameters" id="refsect1-function.geoip-setup-custom-directory-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">path</code></dt>

     <dd>

      <p class="para">
       磁盘上 GeoIP 数据库的绝对路径。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-setup-custom-directory-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-setup-custom-directory-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4501">
    <p><strong>Example #1  <span class="function"><strong>geoip_setup_custom_directory()</strong></span> 例子：</strong></p>
    <div class="example-contents"><p>
     以下例程将会更改 GeoIP 默认数据库的路径。
    </p></div>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />geoip_setup_custom_directory</span><span style="color: #007700">(</span><span style="color: #DD0000">'/some/other/path'</span><span style="color: #007700">);<br /><br />print&nbsp;</span><span style="color: #0000BB">geoip_db_filename</span><span style="color: #007700">(</span><span style="color: #0000BB">GEOIP_COUNTRY_EDITION</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
/some/other/path/GeoIP.dat
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div></div></div></body></html>